<template>
  <van-row gutter="22">
    <van-col v-for="(item, index) in list" :key="index" span="8">
      <div class="scroll" ﻿@tap="goPage('/project/detail?id=' + item.id)" :style="[{animation: 'show ' + ((index+1)*0.1+0.5) + 's 1'}]">
        <img :src="picPre + item.pic" mode="widthFix">
        <p>{{item.title}}</p>
        <div v-if="type === 1">
          <i class="iconfont huoIcon iconhuo" style="font-size: 24rpx;"></i>
          <p>{{item.click_num}} 人关注</p>
        </div>
        <div v-else>
          <i class="iconfont  huoIcon iconyanjing" style="font-size: 20rpx;margin-top: 4rpx"></i>
          <p>{{item.click_num}}</p>
        </div>
      </div>
    </van-col>
  </van-row>
</template>

<script>
    export default {
      name: "card",
      props:{
        list: {
          type: Array
        },
        type:{
            type: Number
        }
      },
      data(){
        let that = this;
        return {
          picPre: that.$api.picPre
        }
      },
      methods:{
        goPage(router){
			uni.navigateTo({
				url: router
			})
			this.info = [];
        }
      }
    }
</script>

<style scoped>
  .scroll{
    font-size: 0;
  }
  .scroll>img{
    width: 100%;
    border-radius: 6rpx;
  }
  .scroll>p{
    width: 174rpx;
    font-size: 26rpx;
    color: #323232;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    margin: 19rpx 0 10rpx 0;
  }
  .scroll>div{
    display: flex;
    color: #EF5A56;
    font-size: 20rpx;
    margin-bottom: 28rpx;
  }
  .huoIcon{
    margin-right: 10rpx;
  }
</style>
